import request from '@/utils/request';

// 锻炼类型树
export function getTree() {
    return request({
        url: '/admin/exercise/series/typeTree',
        method: 'get',
    });
}

// 分页查询-锻炼动作
export function listAction(query : any) {
    return request({
        url: '/admin/exercise/action/list',
        method: 'get',
        params: query,
    });
}

// 根据id获取（动作）
export function getAction(actionId : any) {
    return request({
        url: '/admin/exercise/action/' + actionId,
        method: 'get',
    });
}

// 删除动作
export function delAction(actionId : any) {
    return request({
        url: '/admin/exercise/action/' + actionId,
        method: 'delete',
    });
}

// 编辑动作
export function updateAction(data : any) {
    return request({
        url: '/admin/exercise/action',
        method: 'put',
        data: data,
    });
}

// 新增动作
export function addAction(data : any) {
    return request({
        url: '/admin/exercise/action',
        method: 'post',
        data: data,
    });
}

// 分页查询-锻炼系列
export function listSeries(query : any) {
    return request({
        url: '/admin/exercise/series/list',
        method: 'get',
        params: query,
    });
}

// 根据id获取（系列）
export function getSeries(seriesId : any) {
    return request({
        url: '/admin/exercise/series/' + seriesId,
        method: 'get',
    });
}

// 删除系列
export function delSeries(seriesId : any) {
    return request({
        url: '/admin/exercise/series/' + seriesId,
        method: 'delete',
    });
}

// 编辑系列
export function updateSeries(data : any) {
    return request({
        url: '/admin/exercise/series',
        method: 'put',
        data: data,
    });
}

// 新增系列
export function addSeries(data : any) {
    return request({
        url: '/admin/exercise/series',
        method: 'post',
        data: data,
    });
}

// 根据id获取（系列）
export function getGroup(groupId : any) {
    return request({
        url: '/admin/exercise/group/' + groupId,
        method: 'get',
    });
}

// 新增系列
export function addGroup(data : any) {
    return request({
        url: '/admin/exercise/group',
        method: 'post',
        data: data,
    });
}

// 编辑系列
export function updateGroup(data : any) {
    return request({
        url: '/admin/exercise/group',
        method: 'put',
        data: data,
    });
}

// 删除分组
export function delGroup(groupId : any) {
    return request({
        url: '/admin/exercise/group/' + groupId,
        method: 'delete',
    });
}

// 获取所有会员等级
export function getAllLevel() {
    return request({
        url: '/admin/appuser/level/allName',
        method: 'get',
    });
}
